package com.linwen.excise.huaweiOJ;

import java.util.Scanner;

/**
 * @ClassName 计算三个矩形相较的面积
 * @Description
 * @Author lin
 * @Date 2022/4/15 上午12:57
 * @Version V1.0
 */
public class 计算三个矩形相较的面积 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int[] a = new int[4];
        for (int i = 0; i < 4; i++) {
            a[i] = scanner.nextInt();
        }
        int[] b = new int[4];
        for (int i = 0; i < 4; i++) {
            b[i] = scanner.nextInt();
        }
        int[] c = new int[4];
        for (int i = 0; i < 4; i++) {
            c[i] = scanner.nextInt();
        }
        sq a0 = new sq(a);
        sq b0 = new sq(b);
        sq c0 = new sq(c);
        sq and1 = a0.and(b0);
        if(!sq.checkAnd(and1)){
            System.out.println(0);
        }else {
            sq and2 = and1.and(c0);
            if(!sq.checkAnd(and2)){
                System.out.println(0);
            }else{
                System.out.println(sq.area(and2));
            }
        }
    }


    static class sq{
        int ax,ay,bx,by,cx,cy,dx,dy;
        sq(int[] a){
            int x = a[0];
            int y = a[1];
            int w = a[2];
            int h = a[3];
            ax = x;
            ay = y;
            bx = x+w;
            by = y;
            cx = x+w;
            cy = y-h;
            dx = x;
            dy = y-h;
        };
        static int area(sq a){
            int w = a.bx-a.ax;
            int h = a.by-a.cy;
            return w*h;
        }
        sq(){};
        static boolean checkAnd(sq b){
            if(b.ax==b.dx&&b.ay==b.by&&b.bx==b.cx&&b.cy==b.dy){
                return true;
            }else {
                return false;
            }
        }
        sq and(sq b){
            int x1 = this.ax>b.ax?this.ax:b.ax;
            int y1 = this.ay<b.ay?this.ay:b.ay;

            int x2 = this.bx<b.bx?this.bx:b.bx;
            int y2 = this.by<b.by?this.by:b.by;

            int x3 = this.cx<b.cx?this.cx:b.cx;
            int y3 = this.cy>b.cy?this.cy:b.cy;

            int x4 = this.dx>b.dx?this.dx:b.dx;
            int y4 = this.dy>b.dy?this.dy:b.dy;
            sq sq = new sq();
            sq.ax = x1;sq.ay = y1;
            sq.bx = x2;sq.by = y2;
            sq.cx = x3;sq.cy = y3;
            sq.dx = x4;sq.dy = y4;
            return sq;
        }
    }

}
